import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'get_jump_one_logic.dart';

class GetJumpOnePage extends StatelessWidget {
  const GetJumpOnePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final logic = Get.put(GetJumpOneLogic());
    final state = Get.find<GetJumpOneLogic>().state;

    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        title: const Text('跨页面-One'),
      ),
      body: Center(
        child: GetBuilder<GetJumpOneLogic>(
          builder: (logic){
            return Text('跨页面-Two点击了${logic.count}次',style: const TextStyle(fontSize: 30.0),);
          },
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => logic.toJumpTwo(),
        child: const Icon(Icons.arrow_forward_outlined),
      ),
    );
  }
}
